<include file="inc:header" />
<div class="page" id='{$data.act}'>
<include file="inc:title" />
<div class="content" style="background-color:#fff">
<!--注册页面-->

<img style="width:100%" src="./public/images/zhuce.png">

<div class="register_login" id="register">
		<div class="bg_fff register_login_pd">
			<div class="bb1 bor height w_b">
				 <div class="name">账 户 名</div>
				 <input class="r_l_input w_b_f_1" id="user_name" name="user_name" type="text" placeholder="请输入您的账户名">
			</div>
			<div class="bb1 bor height w_b">
				 <div class="name">输入密码</div>
				 <input class="r_l_input w_b_f_1" id="user_pwd" name="user_pwd" type="password" placeholder="请输入您的密码">
			</div>
			<div class="bb1 bor height w_b">
				 <div class="name">确认密码</div>
				 <input class="r_l_input w_b_f_1" id="user_pwd_confirm" name="user_pwd_confirm" type="password" placeholder="请再次输入您的密码">
			</div>
			<div class="bb1 bor height w_b">
				 <div class="name">手 机 号</div>
				 <input class="r_l_input w_b_f_1" id="phone" name="phone" type="text" placeholder="请输入您的手机号码">
			</div>
			<div class="bb1 bor height w_b">
				 <div class="name">验 证 码</div>
				 <input class="r_l_input w_b_f_1" id="mobile_code" name="mobile_code" type="text" placeholder="请输入验证码">
				 <div class="ui-button_getcode_parent" style="  width:6rem;"><input class="ui-button_getcode " id="getcode" type="button" value="获取验证码"></div>
			</div>
			<div class=" bor height w_b <if condition="$data.wap_referer">hide</if>">
				 <div class="name">推 荐 人</div>
				  <input class="r_l_input w_b_f_1" id="referer" name="referer" type="text"  value="{$data.wap_referer}" placeholder="请输入推荐人手机号/用户名">
			</div>
		</div>
		<div class="register_login_pd">
			<input class="ui-button_login r_l_but" type="submit" onclick="do_register()" name="commit" id="signup-submit" value="注册">
		</div>		
</div>
<script>
function do_register(){
    var sname;
    sname=$.trim($("#Userpwd").val());
    var reg=/^[a-zA-z0-9]{6,}$/;
    var regs=/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/;
    if(reg.test(sname)){
        if(regs.test(sname)){
        }
        else{
            //$.alert("密码安全等级低，请用数字+字母");
            //return false;
        }
    }
    else{
        $.alert("密码长度在6~16之间，只能包含字符、数字和下划线。");
        //return false;
    }
    $.showIndicator();
    var ajaxurl = SITE_DOMAIN +'/index.php?m=home&c=index&a=register&is_ajax=1';
    var query = new Object();
    query.user_name = $.trim($("#user_name").val());
    query.user_pwd = $.trim($("#user_pwd").val());
    query.user_pwd_confirm = $.trim($("#user_pwd_confirm").val());
    query.mobile = $.trim($("#phone").val());
    query.mobile_code = $.trim($("#mobile_code").val());
    query.referer = $.trim($("#referer").val());
    query.post_type = "json";
    $.ajax({
        url:ajaxurl,
        data:query,
        type:"Post",
        dataType:"json",
        success:function(data){
            $.hideIndicator();
            if(data.user_login_status)
            {
                $.alert(data.show_err,function(){
                    RouterURL(SITE_DOMAIN +'/index.php?m=home&c=index&a=register_do','#Registeridno');
                });
            }else{
                $.alert(data.show_err);
            }
        }
        ,error:function(){
            $.hideIndicator();
            $.toast("通信失败");
        }
    });
}
</script>
<include file="inc:footer" />